﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Program06
{
    class Program
    {
        static void Main(string[] args)
        {
            //循环

            ArrayList arr = new ArrayList();
            Console.WriteLine("请输入一个整数（输入0结束）");

            while (int.TryParse(Console.ReadLine(),out int num))
            {
                if (num != 0)
                {
                    Console.WriteLine("请输入一个整数（输入0结束）");
                    arr.Add(num);
                }
                else
                {
                    Console.WriteLine("\r\n结束");
                    if (arr.Count != 0)
                    {
                        int[] nums = new int[arr.Count];
                        arr.CopyTo(nums, 0);

                        Console.WriteLine("最大值是：" + nums.Max());
                        Console.WriteLine("最小值是：" + nums.Min());
                        Console.ReadLine();
                    }
                    break;
                }
            }

            Console.WriteLine("九九乘法表:");
            Multip();
        }
        public static void Multip()
        {
            for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <=i; j++)
                {
                    Console.Write("{0}*{1}={2}\t", j, i, i * j);
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}
